package drawable
{
	import flash.display.Shape;
	import flash.events.MouseEvent;
	

	public class Field extends Shape implements IField
	{
		public var _step:int = 10;
		
		private var _size:int = 500;
		private var _zero:Point;
		
		public function Field()
		{
			super();
		}
		
		/**
		 * квадрат же
		 * */
		public function set size( value:int ):void{
			_size = value;	
		}
		public function get size(  ):int{
			return _size;	
		}
		
		
		public function get zero():IPoint{
			return _zero;
		}
		
		/**
		 * размер клетки
		 * */
		public function set step( _s:int ):void{
			this._step = _s;
		}
		/**
		 * размер клетки
		 * */
		public function get step():int{
			return _step;
		}
		
		/*override public function set width(value:Number):void{ }
		override public function set height(value:Number):void{ }*/
		
		public function draw():void{
			this.graphics.clear();
			var l:int = _size; //this.height
			var i:int = 0;
			while( i <= l  ){
				i += _step;
				if( i == l/2 ){
					this.graphics.lineStyle(1.5, 0x0000, 1);
					this._zero = new drawable.Point(i, i);
				}else{
					this.graphics.lineStyle(1, 0x0000, .1);
				}
				this.graphics.moveTo(i, 0 );
				this.graphics.lineTo(i, l );
				this.graphics.moveTo(0, i );
				this.graphics.lineTo(l, i );
			}
		}
		
	}
}